﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LibrarySystem
{
    public partial class WebForm4 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string _isbn = Request.QueryString["isbn"];
            if (_isbn != "")
            {
                List<BusinessLayer.Book> result = BusinessLayer.Book.getByISBNorTitle("ISBN", _isbn);

                if(result.Count != 0)
                {
                    bookDetailTitle.Text = result[0].Title;
                    bookDetailAuthor.Text = "Författare: " + result[0].Author;
                    bookDetailISBN.Text = "ISBN: " + result[0].ISBN;
                    bookDetailLibNo.Text = "LibNo: " + result[0].LibNo.ToString();
                    bookDetailSignum.Text = "Klassifikation: " + result[0].Signum.ToString();
                    bookDetailCopyCount.Text = "Antal kopior: " + result.Count;

                    bookDetailCopyList.DataSource = result;
                    bookDetailCopyList.DataBind();
                }

            }
        }
    }
}